package tools.cyan.com.myapplication.module.presenter;

import com.cyan.tools.base.BaseListView;
import com.cyan.tools.base.BasePresenterImpl;
import com.cyan.tools.callback.SimpleCallback;

import java.util.ArrayList;

import tools.cyan.com.myapplication.bean.PhoneRecord;
import tools.cyan.com.myapplication.module.contract.TestContract;
import tools.cyan.com.myapplication.module.model.TestModelImpl;

/**
 * Created by pc on 2018/4/25.
 */

public class TestPresenterImpl extends BasePresenterImpl<BaseListView<PhoneRecord>> implements TestContract.Presenter{
    private TestContract.Model model;

    public TestPresenterImpl(BaseListView<PhoneRecord> view) {
        super(view);
        model=new TestModelImpl();
    }

    @Override
    public void fetch(String id, int limit) {
       model.getPhoneRecords(new SimpleCallback<ArrayList<PhoneRecord>>(mView){
           @Override
           public void requestSuccess(ArrayList<PhoneRecord> data) {
               mView.showResult(data);
           }
       },id,limit);
    }

}
